import sys

from PyQt5.QtCore import Qt
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

# 创建窗口
class snakeGame(QMainWindow):
    def __init__(self)-> None:
        super().__init__()
        # 设置窗口标题和大小
        self.setwindoTitle("贪吃蛇游戏v1.0")
        self.resize(640,480)
        # 创建画画板 QFrame
        self.frame = GameFrame(self)
        #设置到当前窗口里
        self.setcentralwidget(self.frame)
        
class GameFrame(QFrame):
    def __init__(self,parent:QWidget)-> None:
        super().__init__(parent)
        
if __name__ == '__main__': 
    app = QApplication(sys.argv)# 创建窗口
    game = snakeGame()
    game.show()
    #让主程序阻塞运行
    sys.exit(app.exec)